package com.qsl.file;

import org.apache.commons.codec.digest.DigestUtils;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

/**
 * @Description:
 * @Author: 博客园@青石路
 * @CreateDate: 2023/2/18 13:17
 **/
public class FileMd5 {

    public static void main(String[] args) throws IOException {
        File file1 = new File("D:/ZQPJ_20230914.xlsx.zip");
        File file2 = new File("D:/ZQPJ_20230914.xlsx");
        long l = file1.lastModified();
        String s = DigestUtils.md5Hex(new FileInputStream(file1));
        String s2 = DigestUtils.md5Hex(new FileInputStream(file2));
        System.out.println(s);
        System.out.println(s2);
    }
}
